Skip to main content

Managing Software Installations With Pia

Pia has implemented a Software Package Manager Feature (via Microsoft Winget) which allows you to store and manage your software installations within Pia.

This provides the following advantages:

  • Installation files are scanned for viruses upon upload and are securely maintained
  • The package manager performs security hash checks upon downloading the files to the end device to ensure the software being installed is not compromised
  • Using Pia to store your software install files means you don't need to figure out where to store your installation files and how to get them onto your end devices
  • Centrally manage your software install files with Pia and use Pia's Install/Uninstall automation, or build your own automations to roll out software from Pia
  • Manage versions of your software install files
  • Add software from the Public Software Repository (maintained by the winget community) to your Pia Software repository

At the current time, Pia provides a single Automation as a part of Pia aiDesk called "Pia: Install/Uninstall Software" which leverages software you have added to the Software Package Manager in Pia.

Learn more about how to upload and manage software in Pia in this article.

Custom Automations to Install Software​

With Pia's Software Package Manager feature, you don't need to worry about where your software installation will be hosted or how to download it securely to your end device. This bypasses the need for you to upload a software to a file share or online storage/web hosting location.

With Pia's Software Package Manager feature, you may create custom automations such as:

  • Install or Uninstall a specific software on demand
  • Update software on a schedule to keep software versions up to date
  • Keep a list of approved software installed on your client's machines (using a schedule to check compliance and install if software is not found)

Refer to the section below for commands on how you can use winget in your own custom automations to install software from Pia's package manager.

Microsoft Winget​

Winget is Microsoft's Software Package Manager which has been developed by Microsoft and is now included in windows 10 and above. Using winget, we can install software from Pia's winget feed (Software Package Manager) via your tenant, here are the basic commands below:

Step One: Add Software to your Pia Software Package Manager
Refer to the Software Screen article here

Step Two: Get a Token
To install the software you've uploaded into Pia via Winget, Pia requires you to add Pia as a "Winget Source Feed" to your machine.

To prevent unauthorised access to your software repository, Pia provides a way to get a secure token. The obtained token will expire within 30 minutes of being issued.
As such, you should obtain a new token each time you want to install software using winget in your custom automation. Tokens can be obtained using the system variable provided by Pia called "$Winget_Unique_Token".

To obtain a token in your custom automation, use the sample provided below:

Note

Token's will be in the format of a GUID, for example: "f4608df3-4a25-42a9-a529-76b96c9be602"

Note

This package does not require any conditions as you are going to run it manually via the execute button

# 1. Copy this sample into the package editor and hit Save.
# 2. Click the "Execute" button in the toolbar.
# 3. Go to "Live Packages" and view the output.
conditions:

steps:
- task: inline_powershell
inputs:
wingetToken: $Winget_Unique_Token
script: |
Write-Host $wingetToken

Step Three: Use Winget to Install Software

The example script below will:

  • Add the Pia winget feed to your computer
  • Install software from your Pia Winget feed
winget source add --name Pia "https://<YOUR_TENANT_NAME>.pia.ai/winget/<WINGET_TOKEN>"  -t Microsoft.Rest
winget install "<SOFTWARE_IDENTIFIER_NAME>" -s Pia
Note

The above steps involve setting up a winget feed on the target device so software files can be downloaded from Pia. The feed URL contains a security token which expires after 30 minutes. Because of the expiry, every time you use a new token, you must run the following command to remove the feed before adding a new feed with the new token:

winget source remove --name Pia

In the above script:

  • <YOUR_TENANT_NAME> should be set to the name of your pia tenant (e.g. https://abc.pia.ai)
  • <WINGET_TOKEN> should be set to the token you obtained earlier
  • <SOFTWARE_IDENTIFIER_NAME> should be set to the Package Identifier of the software (e.g. "Notepad++.Notepad++")